import React from 'react';
import Loadable from 'react-loadable';
import Loading from '../component/Ui/Loading';
export default (path) => {

  const LoadableComponent = Loadable({
    loader: () =>{
      // console.log(path);
      return import (`../component/${path}`);
    },
    loading(props) {
      // console.log(props);
      return ( < Loading / > )
    }
  })

  return class LoadableDashboard extends React.Component {
    render() {
      return <LoadableComponent / > ;
    }
  }
}
